package cn.legend.travel.passport.dao.persist.repository.impl;

import cn.legend.travel.passport.dao.persist.mapper.UserMapper;
import cn.legend.travel.passport.dao.persist.repository.IUserRepository;
import cn.legend.travel.passport.pojo.entity.User;
import cn.legend.travel.passport.pojo.vo.UserLoginInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class UserRepositoryImpl implements IUserRepository {
    @Autowired
    private UserMapper userMapper;

    @Override
    public int insertUser(User user) {
        return userMapper.insert(user);
    }

    @Override
    public void updateById(User user) {
        userMapper.updateById(user);
    }

    @Override
    public UserLoginInfoVO getLoginInfoByUsername(String username) {
        return userMapper.getLoginInfoByUsername(username);
    }

    @Override
    public String getPasswordByUsername(String username) {
        return userMapper.getPasswordByUsername(username);
    }
}
